<?php
/*
+ --------------------------------------------------- +
|  Ineo Article Manager - Version 2.x
|  Copyright 2006-2007, Dan Cryer and William McGann
+ --------------------------------------------------- +

Ineo Article Manager is free software; you can redistribute it and/or modify
it under the terms of version 3 of the GNU General Public License as published by
the Free Software Foundation.

Ineo Article Manager is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Ineo; see the file License.txt.  If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

*/

class overview_plugin_recentedits
{
	// ineo core
	var $core;
	// ipsclass
	var $ipsclass;
	
	// plugin data:
	var $plugin_data = array( 'tab_title' => 'Recently Changed', 'is_tab' => true, 'tab_order' => 2, 'enabled' => true );
	
	/**
	* Constructor - Set variables, load libraries, etc.
	*/
	function overview_plugin_recentedits( &$core )
	{
		// Set variables:
		$this->core     =& $core;
		$this->ipsclass =& $this->core->ipsclass;
		
		// Set lang-friendly title:
		$this->plugin_data['tab_title'] = $this->ipsclass->lang['ineo_optab_recentedits'];
	}
	
	/**
	* Return plugin data to the core 
	*/
	function get_data()
	{
		// Load articles library if not already loaded:
		if( !isset( $this->core->articles ) )
		{
			$this->core->load_library('articles');
		}
		
		$articles = $this->core->libs['articles']->recent_articles('article_edited_date');
		
		if( $this->plugin_data['is_tab'] )
		{
			$articles = array( 'output' => $articles );
			$articles['cols'] = array('article_title' => '75%','article_date' => '25%');
			
			$articles = $this->core->templates['global']->tab_table( $articles );
		}
		
		return $articles;
	}
}

?>